<%@page pageEncoding="UTF-8" contentType="text/html;charset=utf-8" errorPage="/commons/error.jsp"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang='zh-CN' xml:lang='zh-CN' xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>订单更新</title>
<style type="text/css">
table{font-size: 12px;}
</style>
</head>
<body>
<p>更新订单信息：<a href = '${ctx}/admin/order/detail/${order.id }'>${order.id}</a></p>
<hr />
<div>
	<c:if test="${result != null && result.code != 0}">
		<span style="color: red">Warning: ${result.msg }</span>
	</c:if>
	<c:if test="${result.code == 0}">
		<span style="color: blue">${result.msg }</span>
	</c:if>
</div>
<form:form id="form-update" class="form-inline" commandName="order" action="${ctx}/admin/order/update" method="post">
		<form:hidden path="id" />
		<table class="table table-striped">
			<tr>
				<td><label for="id">ID</label></td>
				<td>${order.id }</td>
			</tr>
			<tr>
				<td><label for="user_name">用户名</label></td>
				<td>${order.user_name }</td>
			</tr>
			<tr>
				<td><label for="order_status">种类</label></td>

				<td ><form:radiobuttons path="order_status" itemLabel="description" />
				</td>
			</tr>
			<tr>
				<td><label for="product_name">商品信息</label></td>
				<td>${order.product_name }&nbsp;&nbsp;&nbsp;${order.catalog_name }&nbsp;&nbsp;&nbsp;${order.specification_name }</td>
			</tr>
			<tr>
				<td><label for="virtual">是否虚拟</label></td>
				<td><input type="checkbox" <c:if test="${order.virtual}">checked="checked"</c:if> disabled="disabled"/></td>
			</tr>
			<tr>
				<td><label for="price">价格</label></td>
				<td>${order.price }</td>
			</tr>
			<tr>
				<td><label for="quantity">数量</label></td>
				<td>${order.quantity }</td>
			</tr>
			<tr>
				<td><label for="rec_name">收件人姓名</label></td>
				<td>${order.rec_name }</td>
			</tr>
			<tr>
				<td><label for="phone">收件人电话</label></td>
				<td>${order.phone }</td>
			</tr>
			<tr>
				<td><label for="address">收件人地址</label></td>
				<td>${order.address }</td>
			</tr>
			<tr>
				<td><label for="express_com">快递公司</label></td>
				<td><form:select path="express_com" class="form-control width-200">
						<option></option>
						<form:options items="${express_com}"/>
					</form:select>
				</td>
			</tr>
			<tr>
				<td><label for="express_no">快递单号</label></td>
				<td><form:input path="express_no" class="form-control width-200"
						placeholder="快递单号" /></td>
			</tr>
			<tr>
				<td colspan="2">
					<button type="submit" class="btn btn-primary">更新</button>
				</td>
			</tr>
		</table>
	</form:form>
<script type="text/javascript" src="${ctx}/scripts/lottery.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$("#nav_order").addClass("active");
	});
</script>
</body>
</html>